#!/bin/sh

mkdir -p gutenberg_scifi/plists
mkdir -p gutenberg_scifi/rdfs
mkdir -p gutenberg_scifi/zips

rm catalog.rdf
rm catalog.rdf.bz2
rm gutenberg_scifi/plists
rm gutenberg_scifi/rdfs

pushd GutenMark;
./build.sh
popd

wget http://www.gutenberg.org/feeds/catalog.rdf.bz2

bunzip2 catalog.rdf.bz2

./catalog_splitter.pl

for i in `cat gutenberg_scifi.lst` ; do
    ./plist_gutenberg.pl $i
done